package com.sentiment.strategy;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class IdGenerator {
	public static String generateSrcId(){
		DateFormat df = new SimpleDateFormat("yyyyMMdd");//设置日期格式
		//获取32位的uuid
		UUID id = UUID.randomUUID();
		String srcId = id.toString().replaceAll("-", "");
		srcId = srcId+"-src-"+df.format(new Date());// new Date()为获取当前系统时间
		
		return srcId;
	}
	public static String generateTarId(){
		DateFormat df = new SimpleDateFormat("yyyyMMdd");//设置日期格式
		//获取32位的uuid
		UUID id = UUID.randomUUID();
		String tarId = id.toString().replaceAll("-", "");
		tarId = tarId+"-tar-"+df.format(new Date());// new Date()为获取当前系统时间
		
		return tarId;
	}
}
